<template>
    <el-form-item :label="item.label" :prop="item.key" :labelWidth="item.labelWidth || labelWidth">
        <el-input class="w" v-model="formData[item.key]"
                  :maxlength="item.maxlength"
                  :minlength="item.minlength"
                  :max="item.max"
                  :min="item.min"
                  :showWordLimit="item.showWordLimit"
                  :placeholder="item.placeholder|| `请输入${item.label}`"
                  :showPassword="item.showPassword"
                  :disabled="item.disabled"
                  :size="item.size"
                  :prefixIcon="item.prefixIcon"
                  :suffixIcon="item.suffixIcon"
                  :rows="item.rows"
                  :autosize="{ minRows: item.minRows || 2, maxRows: item.maxRows || 4 }"
                  :readonly="item.readonly"
                  :resize="item.resize"
                  :validateEvent="item.validateEvent"
                  :inputStyle="item.inputStyle"
                  :type="item?.props?.type || ''"
                  :show-password="item.showPassword"
                  @keyup.enter.native="txtChange"
                  :clearable="item.clearable !== false"/>
    </el-form-item>
</template>

<script setup lang="ts">
const { formData, item } = defineProps({
    formData: Object,
    item: Object
})

const emit = defineEmits([ 'txtChange'])

const txtChange = (val)=>{
    emit('txtChange', val)
}
</script>

<style scoped lang="scss">
.el-textarea{
    word-break:break-all
}
</style>


<!--<template>-->
<!--    <el-input v-model="name" />-->
<!--    {{name}}-->
<!--</template>-->

<!--<script setup lang="ts">-->
<!--const { name } =  defineProps({-->
<!--    name:String-->
<!--})-->
<!--console.log(name);-->

<!--const emit = defineEmits(['update:name'])-->
<!--</script>-->

<!--<style scoped lang="scss">-->

<!--</style>-->
